import { axios } from '@/utils/request'

/**
 * 查询采购订单
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function purchaseOrderPage (parameter) {
  return axios({
    url: '/purchaseOrder/page',
    method: 'get',
    params: parameter
  })
}

/**
 * 采购订单列表
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function purchaseOrderList (parameter) {
  return axios({
    url: '/purchaseOrder/list',
    method: 'get',
    params: parameter
  })
}

/**
 * 添加采购订单
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function purchaseOrderAdd (parameter) {
  return axios({
    url: '/purchaseOrder/add',
    method: 'post',
    data: parameter
  })
}

/**
 * 编辑采购订单
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function purchaseOrderEdit (parameter) {
  return axios({
    url: '/purchaseOrder/edit',
    method: 'post',
    data: parameter
  })
}

/**
 * 删除采购订单
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function purchaseOrderDelete (parameter) {
  return axios({
    url: '/purchaseOrder/delete',
    method: 'post',
    data: parameter
  })
}

/**
 * 查询采购订单详情
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function purchaseOrderDetail (code) {
  return axios({
    url: '/purchaseOrder/detail',
    method: 'get',
    params: { code: code }
  })
}

/**
 * 采购订单列表:未完成
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
 export function purchaseOrderUndoneList (supplier) {
  return axios({
    url: '/purchaseOrder/undoneList',
    method: 'get',
    params: { supplierId: supplier }
  })
}
